<script setup lang="ts">
import { PropType } from 'vue'
import type { ViewData } from '@/api/types/userType'
import { Descriptions } from '@/components/Descriptions'
import { ElTag } from 'element-plus'

defineProps({
  currentRow: {
    type: Object as PropType<Nullable<ViewData>>,
    default: () => null
  },
  detailSchema: {
    type: Array as PropType<DescriptionsSchema[]>,
    default: () => []
  }
})
</script>

<template>
  <Descriptions :schema="detailSchema" :data="currentRow || {}">
    <template #status="{ row }: { row: ViewData }">
      <ElTag :type="row.status === 'normal' ? 'success' :  'warning'" >
        {{
          row.status === 'normal'
            ? "正常"
            : '锁定'
        }}
      </ElTag>
    </template>    
  </Descriptions>
</template>
